//
//  BaseViewController.m
//  收纳
//
//  Created by  on 2022/10/26.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.bgHexColor = @"#F6F6F6";
    [self.backBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
}

- (UIStatusBarStyle)preferredStatusBarStyle{
    return UIStatusBarStyleDefault;
}
- (void)takePic{
    WS(self)
    [self sheet:nil :nil :@[@"拍摄",@"相册"] :^(NSInteger index, NSString * _Nonnull title) {
        dispatch_async(dispatch_get_main_queue(), ^{
            [CCHud startHud];
        });
        UIImagePickerController *vc = [UIImagePickerController new];
        vc.delegate = weakself;
        vc.allowsEditing = YES;
        vc.sourceType = index == 0 ? UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypePhotoLibrary;
        vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
        [[weakself currentVC] presentViewController:vc animated:YES completion:^{
            [CCHud stopHud];
        }];
    }];
}
@end
